<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body style="padding:10px;">
<p>说明：
    <span>mybatis-plus querywrapper的条件查询中,查询条件大于4个,抽取一个方法,如逻辑复杂,抽取到xml?</span>
</p>
<br/>
<p>正例：</p>
<div style="margin:10px;padding:10px;border:1px solid #000000;white-space: pre-line;">
    &lt;select id=&quot;selectNeedSendEmail&quot; resultMap=&quot;BaseResultMap&quot;&gt;
    SELECT id,name FROM rec_questionnaire_survey WHERE audit_status IN(3,5) AND is_delete = 0
    AND is_audit_end = 0 AND is_send = 0 AND push_status = 2 AND is_email = 1
    AND start_time &lt;![CDATA[ &lt; ]]&gt; #{now} AND end_time &lt;![CDATA[ &gt; ]]&gt; #{now}
    &lt;/select&gt;
</div>
<br/>
<p>反例：</p>
<div style="margin:10px;padding:10px;border:1px solid #000000;white-space: pre-line;">
<br/>    final Integer num =  this.empPlanService.count(new CommonQueryWrapper&lt;LtgEmployeeLearningPlan&gt;()
<br/>                .eq(LtgEmployeeLearningPlan::getEmpOriginId, certification.getEmpOriginId())
<br/>                .eq(LtgEmployeeLearningPlan::getInfoId, certification.getId())
<br/>                .eq(LtgEmployeeLearningPlan::getPlanType,
<br/>                Integer.parseInt(Constants.PlanType.SITE.getValue()))
<br/>                .in(LtgEmployeeLearningPlan::getCourseId,
<br/>                Arrays.asList(courseIds.split(&quot;,&quot;)).stream().map(Long::valueOf)
<br/>                .collect(Collectors.toList()))
<br/>                .notIn(LtgEmployeeLearningPlan::getPlanStatus,
<br/>                Arrays.asList(EmpPlanStatusEnum.COMPLETED.getValue(),
<br/>                EmpPlanStatusEnum.OVERTIME_COMPLETE.getValue(),
<br/>                EmpPlanStatusEnum.FORCE_COMPLETED.getValue()))
<br/>                .eq(Const.DELETE_FIELD, Const.DELETE_NOT));

</div>
</body>
</html>